#include <iostream>
#include <vector>
#include <queue>
#include <algorithm>

using ll = long long;
static auto &is = std::cin;
static auto &os = std::cout;

static const ll max_n = 1e4+5;

static ll n, m, a, b;
static std::vector<ll> next[max_n];
static bool vis[max_n];
static std::queue<ll> q;
static int colors[max_n];
static ll color_sum[3], ans;
void set_color(const ll n,const int color)noexcept{
    colors[n]=color;
    color_sum[color]++;
}

void flush_exit()noexcept{
    os<<std::flush;
    _Exit(0);
}

void bfs(){
    for(ll i{1};i<=n;i++){
        color_sum[1]=color_sum[2]=0;
        if(vis[i])continue;
        q.push(i);
        set_color(i, 1);
        vis[i]=true; // 注意初始化错误
        while(!q.empty()){
            const auto front = q.front();
            q.pop();

            for(const auto i:next[front]){
                if(vis[i]){
                    if(colors[i]==colors[front]){
                        os<<"Impossible\n";
                        flush_exit();
                    }
                    continue;
                }
                set_color(i,(colors[front]&1)+1);
                vis[i]=true;
                q.push(i);
            }
        }
        ans+=std::min(color_sum[1],color_sum[2]);
    }
}

int main(){
    is>>n>>m;
    for(ll i{0};i<m;i++){
        is>>a>>b;
        next[a].push_back(b);
        next[b].push_back(a);
    }

    bfs();
    os<<ans<<'\n';
    flush_exit();
}